'Calculates the Percentvalue of a given value depending on a maximum value.


Public Function Percent(ByVal CurrVal As Long, ByVal MaxVal As Long) As Integer
    Return Int(CurrVal / MaxVal * 100 + 0.5)
End Function